import { C0LUMNS, INVENTORY_COORDINATION } from './index.const';
import ElEditable from '@components/el-editable';
// import { IndexService } from './index.service';
// const indexService = new IndexService();
export default {
  components: {
    ElEditable
  },
  inject: ['apiMMallWeb'],
  data() {
    return {
      C0LUMNS,
      orderDetail: {},
      activeStep: 1,
      orderId: '',
      busModel: 3,
      activeIndex: 0,
      order_tab: [
        { title: '订单产品明细', columns: INVENTORY_COORDINATION, tabData: [] },
        { title: '消耗产品明细', columns: INVENTORY_COORDINATION, tabData: [] }
      ],
      payload: [],
      orderOperation: {} //手术信息
    };
  },
  async created() {
    this.orderId = this.$route.query.id;
    //根据id获取列表详情
    const detail = await this.apiMMallWeb.OrderDetailOrderV1ApiPOST({
      query: { orderId: this.orderId, page: 0, pageSize: 20 }
    });
    // indexService.getTransportName(detail);
    this.orderDetail = detail;
    //根据orderId获取手术信息
    const orderOperation = await this.apiMMallWeb.OrderOperationOrderV1ApiPOST({
      query: { orderId: '1', page: 0, pageSize: 20 }
    });
    this.orderOperation = orderOperation;
    this.order_tab[0].tabData = res.content;
    //订单详情采购产品分页列表
    const pruduct = await this.apiMMallWeb.PageListOrderDetailProductOrderV1ApiPOST({
      query: {
        orderDetailId: this.orderDetail.orderDetailId,
        page: 0,
        pageSize: 0
      }
    });
    this.payload = pruduct.content;
  },
  methods: {
    changeIndex(index) {
      this.activeIndex = index;
    }
  }
};
